package cn.sciento.boot.transfer.infra.feign;

import cn.sciento.boot.transfer.api.dto.EventErrorDTO;
import cn.sciento.boot.transfer.api.dto.EventSendDTO;
import cn.sciento.boot.transfer.infra.feign.fallback.HdttRemoteServiceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "${stong.service.transfer.name:stong-transfer}", contextId = "HdttRemoteService",fallbackFactory = HdttRemoteServiceFactory.class)
public interface HdttRemoteService {
  @PostMapping({"/v1/event-sends"})
  EventSendDTO createEventSend(@RequestBody EventSendDTO eventSendDTO);
  
  @PostMapping({"/v1/event-errors"})
  EventErrorDTO createEventError(@RequestBody EventErrorDTO eventErrorDTO);
  
  @GetMapping({"/v1/distribution-ids/{bizType}"})
  Long getDistributionId(@PathVariable("bizType") String bizType);
}
